<?php
/**
 * @file test008.php
 * @package taobaoke
 * @subpackage 
 * @author LD King (mifunny.info)
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 * 获取SessionKey的容器地址：http://container.open.taobao.com/container?appkey=12001409 
 * 测试数据获取完整性！ 
 * 
 * http://my.donews.com/ak47/2006/08/03/QMJitGhMEbHXEUGQPdxRfhPUTybKBgynafUZ/
 * Wordpress的XMLrpc
 * 
 * iid(32) - 8ac5563fafed3cd672aa7bc059bb9719
title(44) - 【四皇冠】全新港行HKC Pearl珍珠手机WM6.1+624CPU+WIFI+GPS机
nick(15) - laoqiu113232527
 * 
 */

header("Content-Type:text/html;charset=UTF-8");
require_once '../lib/functions.php';
require_once '../lib/db.class.php';

$session = trim($_GET['top_session']);
$cid = 50010388;
// 30 男装； 28 ZIPPO/瑞士军刀/眼镜


$re = getTaobaokeItems($session,30);
for($i=0; $i<count($re); $i++){
/*	foreach($re[$i] as $k => $v ){
		echo '<br />'.$k.'('.utf8_strlen($v).') - '.$v;
	}*/
	$re2 = getTaobaoItem($session, $re[$i]['nick'],$re[$i]['iid']);
/*	foreach($re2 as $k => $v ){
		echo '<br />'.$k.' - '.$v;
	}*/
	
	$item = array(
		'iid' => $re[$i]['iid'],
		'title' => $re[$i]['title'],
		'pic_url' => $re[$i]['pic_url'],
		'price' => $re[$i]['price'],
		'click_url' => $re[$i]['click_url'],
		'nick' => $re[$i]['nick'],
		'commission' => $re[$i]['commission'],
		'commission_rate' => $re[$i]['commission_rate'],
		'commission_num' => $re[$i]['commission_num'],
		'commission_volume' => $re[$i]['commission_volume'],
		'cid' => $re2['cid'],
		'title2' => $re2['title2'],
		'location' => $re2['location'],
		'properties' => $re2['properties']
	);
	$db = new tbkDB($item);
	$db->inItem($item);
	
	
	
/*	$re3 = getTaobaokeShop($session,$re[$i]['nick']);
	foreach($re3 as $k => $v ){
		echo '<br />'.$k.' - '.$v;
	}*/
//	echo '<br /><hr /><br />';
}

/*$re = getTaobaoItem($session,'laoqiu113232527','8ac5563fafed3cd672aa7bc059bb9719');
//var_dump($re);*/

/*$re = getTaobaokeItems($session,$cid);

for($i = 0; $i<count($re); $i++){
	foreach($re[$i] as $k => $v){
		echo '<br />'.$k.' - '.$v;
	}
}*/

?>